package com.googlecode.openauth.web.action;

import org.apache.log4j.Logger;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.googlecode.openauth.web.dao.IActionDao;

public class ActionInfoActionTest {

	private static Logger logger = Logger.getLogger(ActionInfoActionTest.class);
	
	private static ApplicationContext context;
	
	private static IActionDao actionDao;
	
	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
		context = new ClassPathXmlApplicationContext("applicationContext.xml");
		actionDao = (IActionDao)context.getBean("actionDao");
	}

	@AfterClass
	public static void tearDownAfterClass() throws Exception {
	}

	@Before
	public void setUp() throws Exception {
	}

	@After
	public void tearDown() throws Exception {
	}
	
	@Test
	public void testExecute() {
		ActionInfoAction action = new ActionInfoAction();
		action.setActionDao(actionDao);
		try {
			int count = action.getAllCount();
			logger.info(" get all count : "+count);
		} catch (Exception e) {
			logger.error(e.getMessage(), e);
		}
	}

}
